<?php
/**
 * Created by PhpStorm.
 * User: lzy
 * Date: 2018/11/15
 * Time: 15:32
 */

namespace App\FreeBird\Controllers\Home;

use App\Admin\Contracts\ConfigInterface;
use App\Base\Controllers\Controller;
use Illuminate\Http\Request;

class ConfigController extends Controller
{

    /**
     * 获取配置信息
     * @return ConfigInterface
     */
    public function getConfigInterface()
    {
        return app()->make(ConfigInterface::class);
    }

    public function getConfigInfo(Request $request)
    {
        //获取配置子类
        $where = function ($query) {
            $query->where("pid",53);
        };
        $ids=$this->getConfigInterface()->getConfigClassMenuListAllId($where);

        $bwhere=function($query)use ($ids){
            $query->whereIn("type",$ids->toArray());
        };
        return $this->getConfigInterface()->getConfigListAll($bwhere);
    }
}